package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.POrder;
import com.ruoyi.system.domain.vo.POrderVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 咨询订单Mapper接口
 *
 * @author ruoyi
 * @date 2022-07-25
 */
public interface POrderMapper extends BaseMapperPlus<POrderMapper, POrder, POrderVo> {

    /**
     * 联查
     */
    Page<POrder> selectMyLeftPage(@Param("build") Page<POrder> build, @Param("ew") QueryWrapper<POrder> lqw);

    /**
     * 根据id查询订单
     */
    POrder selectMyById(Long id);

    /**
     * 分页查询我的订单
     * @param build
     * @param userId
     * @return
     */
    List<POrder> listMyOrder(@Param("pageQuery") PageQuery pageQuery, @Param("userId") Long userId, @Param("orderStatus") String orderStatus);

    POrder selectByOrderNo(@Param("orderNo") String orderNo);
}
